package org.example.mediator;

/**
 * @author wangbin
 * @date 2024/4/19
 * @vesion 1.0
 */
public class Alarm extends Colleague {
    public Alarm(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name);
    }
    public void sendAlarm(int stateChange){
        sendMessage(stateChange);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().getMessag(stateChange,this.name);

    }
}
